<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>Option.h</h1><a href="Option_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
00002 <span class="comment"></span>
00003 <span class="comment"> @File         Option.h</span>
00004 <span class="comment"></span>
00005 <span class="comment"> @Title        Option</span>
00006 <span class="comment"></span>
00007 <span class="comment"> @Version      </span>
00008 <span class="comment"></span>
00009 <span class="comment"> @Copyright    Copyright (C)  Imagination Technologies Limited.</span>
00010 <span class="comment"></span>
00011 <span class="comment"> @Platform     Independent</span>
00012 <span class="comment"></span>
00013 <span class="comment"> @Description  A class to represent a single variable option in the options menu</span>
00014 <span class="comment"></span>
00015 <span class="comment">******************************************************************************/</span>
00016 
00017 <span class="preprocessor">#ifndef OPTION_H</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#define OPTION_H</span>
00019 <span class="preprocessor"></span>
00020 <span class="comment">/******************************************************************************</span>
00021 <span class="comment">Includes</span>
00022 <span class="comment">******************************************************************************/</span>
00023 <span class="preprocessor">#include "PVRTools.h"</span>
00024 <span class="preprocessor">#include "<a class="code" href="dynamicArray_8h.html">dynamicArray.h</a>"</span>
00025 
00026 <span class="keyword">namespace </span>pvrengine
00027 {
00028     <span class="comment">/*!***************************************************************************</span>
00029 <span class="comment">    ** Forward Declaration of OptionsMenu class</span>
00030 <span class="comment">    *****************************************************************************/</span>
00031     <span class="keyword">class </span>OptionsMenu;
00032 
00033     <span class="comment">/*!***************************************************************************</span>
00034 <span class="comment">    ** Option superclass</span>
00035 <span class="comment">    *****************************************************************************/</span>
00036     <span class="comment">/*!***************************************************************************</span>
00037 <span class="comment">    * @Class Option</span>
00038 <span class="comment">    * @Brief A class to represent a single variable option in the options menu.</span>
00039 <span class="comment">    * @Description A class to represent a single variable option in the options menu.</span>
00040 <span class="comment">    *****************************************************************************/</span>
00041     <span class="keyword">class </span>Option
<a name="l00042"></a><a class="code" href="classpvrengine_1_1Option.html">00042</a>     {
00043     <span class="keyword">public</span>:
00044     <span class="comment">/*!***************************************************************************</span>
00045 <span class="comment">    @Function           Option</span>
00046 <span class="comment">    @Description        blank constructor.</span>
00047 <span class="comment">    *****************************************************************************/</span>
00048         <a class="code" href="classpvrengine_1_1Option.html#a0">Option</a>(){}
00049 
<a name="l00050"></a><a class="code" href="classpvrengine_1_1Option.html#a0">00050</a>     <span class="comment">/*!***************************************************************************</span>
00051 <span class="comment">    @Function           Option</span>
00052 <span class="comment">    @Input              strOption    name of option</span>
00053 <span class="comment">    @Description        Base constructor just taking name of option.</span>
00054 <span class="comment">    *****************************************************************************/</span>
00055         <a class="code" href="classpvrengine_1_1Option.html#a0">Option</a>(<span class="keyword">const</span> CPVRTString&amp; strOption):<a class="code" href="classpvrengine_1_1Option.html#p0">m_strOption</a>(strOption){}
00056 
00057     <span class="comment">/*!***************************************************************************</span>
<a name="l00058"></a><a class="code" href="classpvrengine_1_1Option.html#a1">00058</a> <span class="comment">    @Function           ~Option</span>
00059 <span class="comment">    @Description        destructor.</span>
00060 <span class="comment">    *****************************************************************************/</span>
00061         <span class="keyword">virtual</span> <a class="code" href="classpvrengine_1_1Option.html#a2">~Option</a>(){}
00062 
00063     <span class="comment">/*!***************************************************************************</span>
00064 <span class="comment">    @Function           nextValue</span>
<a name="l00065"></a><a class="code" href="classpvrengine_1_1Option.html#a2">00065</a> <span class="comment">    @Description        sets the next value as current</span>
00066 <span class="comment">    *****************************************************************************/</span>
00067         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classpvrengine_1_1Option.html#a3">nextValue</a>(){}
00068 
00069     <span class="comment">/*!***************************************************************************</span>
00070 <span class="comment">    @Function           prevValue</span>
00071 <span class="comment">    @Description        sets the previous value as current</span>
<a name="l00072"></a><a class="code" href="classpvrengine_1_1Option.html#a3">00072</a> <span class="comment">    *****************************************************************************/</span>
00073         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classpvrengine_1_1Option.html#a4">prevValue</a>(){}
00074 
00075     <span class="comment">/*!***************************************************************************</span>
00076 <span class="comment">    @Function           getDisplayValue</span>
00077 <span class="comment">    @Description        retrieves a displayable version of the current value of</span>
00078 <span class="comment">    this option</span>
<a name="l00079"></a><a class="code" href="classpvrengine_1_1Option.html#a4">00079</a> <span class="comment">    *****************************************************************************/</span>
00080         <span class="keyword">virtual</span> CPVRTString <a class="code" href="classpvrengine_1_1Option.html#a5">getDisplayValue</a>(){ <span class="keywordflow">return</span> CPVRTString(<span class="stringliteral">"ERROR"</span>);}
00081 
00082         <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classpvrengine_1_1OptionsMenu.html">OptionsMenu</a>;
00083     <span class="keyword">protected</span>:
00084         CPVRTString         m_strOption;            <span class="comment">// name of option</span>
00085     };
00086 
<a name="l00087"></a><a class="code" href="classpvrengine_1_1Option.html#a5">00087</a>     <span class="comment">/*!***************************************************************************</span>
00088 <span class="comment">    * @Class OptionEnum</span>
<a name="l00089"></a><a class="code" href="classpvrengine_1_1Option.html#n0">00089</a> <span class="comment">    * @Brief An option class for discrete values usually with string names.</span>
00090 <span class="comment">    * @Description An option class for discrete values usually with string names.</span>
<a name="l00091"></a><a class="code" href="classpvrengine_1_1Option.html#p0">00091</a> <span class="comment">    *****************************************************************************/</span>
00092     <span class="keyword">class </span><a class="code" href="classpvrengine_1_1OptionEnum.html">OptionEnum</a> : <span class="keyword">public</span> <a class="code" href="classpvrengine_1_1Option.html">Option</a>
00093     {
00094     <span class="keyword">public</span>:
00095     <span class="comment">/*!***************************************************************************</span>
00096 <span class="comment">    @Function           OptionEnum</span>
00097 <span class="comment">    @Input              strOption       name of option</span>
00098 <span class="comment">    @Input              pstrValues      the string array of value names</span>
00099 <span class="comment">    @Input              u32NumValues    number of values for this option</span>
<a name="l00100"></a><a class="code" href="classpvrengine_1_1OptionEnum.html">00100</a> <span class="comment">    @Input              u32CurrentValue intial value for option</span>
00101 <span class="comment">    @Description        Constructor.</span>
00102 <span class="comment">    *****************************************************************************/</span>
00103         <a class="code" href="classpvrengine_1_1OptionEnum.html#a0">OptionEnum</a>(<span class="keyword">const</span> CPVRTString&amp; strOption,
00104             <span class="keyword">const</span> CPVRTString *pstrValues,
00105             <span class="keyword">const</span> <span class="keywordtype">int</span> u32NumValues,
00106             <span class="keywordtype">int</span> u32CurrentValue=0);
00107     <span class="comment">/*!***************************************************************************</span>
00108 <span class="comment">    @Function           nextValue</span>
00109 <span class="comment">    @Description        sets the next value as current</span>
00110 <span class="comment">    *****************************************************************************/</span>
00111         <span class="keywordtype">void</span> <a class="code" href="classpvrengine_1_1OptionEnum.html#a1">nextValue</a>();
00112     <span class="comment">/*!***************************************************************************</span>
00113 <span class="comment">    @Function           prevValue</span>
00114 <span class="comment">    @Description        sets the previous value as current</span>
00115 <span class="comment">    *****************************************************************************/</span>
00116         <span class="keywordtype">void</span> <a class="code" href="classpvrengine_1_1OptionEnum.html#a2">prevValue</a>();
00117     <span class="comment">/*!***************************************************************************</span>
00118 <span class="comment">    @Function           getValue</span>
00119 <span class="comment">    @Description        gets the current value</span>
00120 <span class="comment">    *****************************************************************************/</span>
00121         <span class="keywordtype">int</span> <a class="code" href="classpvrengine_1_1OptionEnum.html#a3">getValue</a>(){ <span class="keywordflow">return</span> m_i32CurrentValue;}
00122     <span class="comment">/*!***************************************************************************</span>
00123 <span class="comment">    @Function           getDisplayValue</span>
00124 <span class="comment">    @Description        retrieves a displayable version of the current value of</span>
00125 <span class="comment">    this option</span>
00126 <span class="comment">    *****************************************************************************/</span>
00127         CPVRTString <a class="code" href="classpvrengine_1_1OptionEnum.html#a4">getDisplayValue</a>();
00128     <span class="keyword">private</span>:
00129         <span class="keyword">const</span> CPVRTString           *m_pstrValues;  <span class="comment">// array of readable values</span>
00130         <span class="keyword">const</span> <span class="keywordtype">int</span>   m_i32NumValues;         <span class="comment">// number of values for this option</span>
00131         <span class="keywordtype">int</span> m_i32CurrentValue;      <span class="comment">// current value of option</span>
00132     };
<a name="l00133"></a><a class="code" href="classpvrengine_1_1OptionEnum.html#a3">00133</a> 
00134     <span class="comment">/*!***************************************************************************</span>
00135 <span class="comment">    * @Class OptionInt</span>
00136 <span class="comment">    * @Brief An option class for continuous integer values.</span>
00137 <span class="comment">    * @Description An option class for continuous integer values.</span>
00138 <span class="comment">    *****************************************************************************/</span>
00139     <span class="keyword">class </span><a class="code" href="classpvrengine_1_1OptionInt.html">OptionInt</a> : <span class="keyword">public</span> <a class="code" href="classpvrengine_1_1Option.html">Option</a>
00140     {
00141     <span class="keyword">public</span>:
00142     <span class="comment">/*!***************************************************************************</span>
00143 <span class="comment">    @Function           OptionInt</span>
00144 <span class="comment">    @Input              strOption       name of option</span>
00145 <span class="comment">    @Input              i32Low          Lowest desired value for integer</span>
00146 <span class="comment">    @Input              i32High         Highest desired value for integer</span>
00147 <span class="comment">    @Input              i32Add          step interval for values</span>
00148 <span class="comment">    @Input              i32CurrentValue intial value for option</span>
00149 <span class="comment">    @Description        Constructor.</span>
00150 <span class="comment">    *****************************************************************************/</span>
00151         <a class="code" href="classpvrengine_1_1OptionInt.html#a0">OptionInt</a>(<span class="keyword">const</span> CPVRTString&amp; strOption,
00152             <span class="keywordtype">int</span> i32Low, <span class="keywordtype">int</span> i32High, <span class="keywordtype">int</span> i32Add = 1,
<a name="l00153"></a><a class="code" href="classpvrengine_1_1OptionInt.html">00153</a>             <span class="keywordtype">int</span> i32CurrentValue=0);
00154     <span class="comment">/*!***************************************************************************</span>
00155 <span class="comment">    @Function           nextValue</span>
00156 <span class="comment">    @Description        sets the next value as current</span>
00157 <span class="comment">    *****************************************************************************/</span>
00158         <span class="keywordtype">void</span> <a class="code" href="classpvrengine_1_1OptionInt.html#a1">nextValue</a>();
00159     <span class="comment">/*!***************************************************************************</span>
00160 <span class="comment">    @Function           prevValue</span>
00161 <span class="comment">    @Description        sets the previous value as current</span>
00162 <span class="comment">    *****************************************************************************/</span>
00163         <span class="keywordtype">void</span> <a class="code" href="classpvrengine_1_1OptionInt.html#a2">prevValue</a>();
00164     <span class="comment">/*!***************************************************************************</span>
00165 <span class="comment">    @Function           getValue</span>
00166 <span class="comment">    @Description        gets the current value</span>
00167 <span class="comment">    *****************************************************************************/</span>
00168         <span class="keywordtype">int</span> <a class="code" href="classpvrengine_1_1OptionInt.html#a3">getValue</a>(){ <span class="keywordflow">return</span> m_i32CurrentValue;}
00169     <span class="comment">/*!***************************************************************************</span>
00170 <span class="comment">    @Function           getDisplayValue</span>
00171 <span class="comment">    @Description        retrieves a displayable version of the current value of</span>
00172 <span class="comment">    this option</span>
00173 <span class="comment">    *****************************************************************************/</span>
00174         CPVRTString <a class="code" href="classpvrengine_1_1OptionInt.html#a4">getDisplayValue</a>();
00175     <span class="keyword">private</span>:
00176         <span class="keywordtype">int</span> m_i32Low,m_i32High,m_i32Add;    <span class="comment">// interval and step for integer values</span>
00177         <span class="keywordtype">int</span> m_i32CurrentValue;              <span class="comment">// current value of option</span>
00178     };
00179 
00180     <span class="comment">/*!***************************************************************************</span>
00181 <span class="comment">    * @Class OptionFloat</span>
00182 <span class="comment">    * @Brief An option class for continuous floating point values.</span>
00183 <span class="comment">    * @Description An option class for continuous floating point values.</span>
00184 <span class="comment">    *****************************************************************************/</span>
00185     <span class="keyword">class </span>OptionFloat : <span class="keyword">public</span> Option
<a name="l00186"></a><a class="code" href="classpvrengine_1_1OptionInt.html#a3">00186</a>     {
00187     <span class="keyword">public</span>:
00188     <span class="comment">/*!***************************************************************************</span>
00189 <span class="comment">    @Function           OptionFloat</span>
00190 <span class="comment">    @Input              strOption       name of option</span>
00191 <span class="comment">    @Input              fLow            Lowest desired value for float</span>
00192 <span class="comment">    @Input              fHigh           Highest desired value for float</span>
00193 <span class="comment">    @Input              fAdd            step interval for values</span>
00194 <span class="comment">    @Input              fCurrentValue   initial value for option</span>
00195 <span class="comment">    @Description        Constructor.</span>
00196 <span class="comment">    *****************************************************************************/</span>
00197         <a class="code" href="classpvrengine_1_1OptionFloat.html#a0">OptionFloat</a>(<span class="keyword">const</span> CPVRTString&amp; strOption,
00198             <span class="keywordtype">float</span> fLow, <span class="keywordtype">float</span> fHigh, <span class="keywordtype">float</span> fAdd,
00199             <span class="keywordtype">float</span> fCurrentValue=0.0f);
00200     <span class="comment">/*!***************************************************************************</span>
00201 <span class="comment">    @Function           nextValue</span>
00202 <span class="comment">    @Description        sets the next value as current</span>
00203 <span class="comment">    *****************************************************************************/</span>
00204         <span class="keywordtype">void</span> <a class="code" href="classpvrengine_1_1OptionFloat.html#a1">nextValue</a>();
<a name="l00205"></a><a class="code" href="classpvrengine_1_1OptionFloat.html">00205</a>     <span class="comment">/*!***************************************************************************</span>
00206 <span class="comment">    @Function           prevValue</span>
00207 <span class="comment">    @Description        sets the previous value as current</span>
00208 <span class="comment">    *****************************************************************************/</span>
00209         <span class="keywordtype">void</span> <a class="code" href="classpvrengine_1_1OptionFloat.html#a2">prevValue</a>();
00210     <span class="comment">/*!***************************************************************************</span>
00211 <span class="comment">    @Function           getValue</span>
00212 <span class="comment">    @Description        gets the current value</span>
00213 <span class="comment">    *****************************************************************************/</span>
00214         <span class="keywordtype">float</span> <a class="code" href="classpvrengine_1_1OptionFloat.html#a3">getValue</a>(){ <span class="keywordflow">return</span> m_fCurrentValue;}
00215     <span class="comment">/*!***************************************************************************</span>
00216 <span class="comment">    @Function           getDisplayValue</span>
00217 <span class="comment">    @Description        retrieves a displayable version of the current value of</span>
00218 <span class="comment">    this option</span>
00219 <span class="comment">    *****************************************************************************/</span>
00220         CPVRTString <a class="code" href="classpvrengine_1_1OptionFloat.html#a4">getDisplayValue</a>();
00221     <span class="keyword">private</span>:
00222         <span class="keywordtype">float</span>   m_fLow,m_fHigh,m_fAdd;  <span class="comment">// interval and step for float values</span>
00223         <span class="keywordtype">float</span>   m_fCurrentValue;        <span class="comment">// current value of option</span>
00224     };
00225 
00226 
00227 
00228     <span class="comment">/*!***************************************************************************</span>
00229 <span class="comment">    ** commonly required string options</span>
00230 <span class="comment">    *****************************************************************************/</span>
00231     <span class="keyword">static</span> CPVRTString strOnOff[] =
00232     {
00233         <span class="stringliteral">"Off"</span>,<span class="stringliteral">"On"</span>
00234     };
00235 
00236     <span class="keyword">static</span> CPVRTString strTrueFalse[] =
00237     {
<a name="l00238"></a><a class="code" href="classpvrengine_1_1OptionFloat.html#a3">00238</a>         <span class="stringliteral">"True"</span>,<span class="stringliteral">"False"</span>
00239     };
00240 }
00241 
00242 <span class="preprocessor">#endif // OPTION_H</span>
00243 <span class="preprocessor"></span>
00244 <span class="comment">/******************************************************************************</span>
00245 <span class="comment">End of file (Option.h)</span>
00246 <span class="comment">******************************************************************************/</span>
00247 
</pre></div><br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
